﻿
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using YDModel;
using YDServices.Comm;

namespace YDServices
{
    public class OrderReportService : BaseService
    {
        /// <summary>
        /// 查询
        /// </summary>
        /// <param name="conds"></param>
        /// <returns></returns>
        public List<V_Order_Report> getList(ConditionItem[] conds)
        { 
             try
            {
                using (YDDataEntities db = new YDDataEntities())
                {
                    var list = db.V_Order_Report.AsQueryable();
                    if (conds != null)
                    {
                        var qb = QueryBuilder<V_Order_Report>.Create().AddConditions(conds);
                        list = list.Where(qb.ToExpression());
                    }
                    return list.ToList();
                }
            }
            catch (Exception ex)
            {
                Errors.Add(ex);
                WriteException(ex);
                return null;
            }
        }
 

    }
}
